package com.dq.controller.op.opboss.set;

import com.dq.exception.customException.AdminException;
import com.dq.controller.in.GiftSetQuery;
import com.dq.vo.Vo;
import com.dq.vo.baseVo.VO;
import com.dq.domain.setup.GiftGrantSet;
import com.dq.service.AllService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.*;

/**
 * @Author luchangtong
 * @Date 2019/12/27 16:13
 */
@Api(description = "后台礼物发放设置")
@RestController
@RequestMapping("/sys/boss/giftGrantSet")
public class GiftGrantSetController extends AllService {


    @ApiOperation("列表")
    @PostMapping("list")
    @RequiresPermissions("sys:giftGrantSet:list")
    public Vo list(@RequestBody GiftSetQuery giftSetQuery)throws AdminException {
        return giftGrantSetService.list(giftSetQuery);
    }

    @ApiOperation("添加")
    @PostMapping("add")
    @RequiresPermissions("sys:giftGrantSet:add")
    public Vo add(@RequestBody GiftGrantSet giftGrantSet)throws AdminException {

        return giftGrantSetService.add(giftGrantSet);
    }

    @ApiOperation("编辑")
    @PostMapping("edit/{id}")
    @RequiresPermissions("sys:giftGrantSet:edit")
    public Vo edit(@PathVariable Long id, @RequestBody GiftGrantSet giftGrantSetEdit)throws AdminException {
        return giftGrantSetService.edit(id, giftGrantSetEdit);
    }
    @ApiOperation("删除")
    @PostMapping("delete/{id}")
    @RequiresPermissions("sys:giftGrantSet:delete")
    public VO delete(@PathVariable Long id)throws AdminException {
        return giftGrantSetService.delete(id);
    }
}
